Execute in place (XIP) images are fixed position images and are built to execute on a CPU or processor from a specific location in a computer memory device. The location must be accessible in a linear format so that the CPU can fetch and execute individual instructions; thus, DRAM and NOR flash memory are commonly used memory storage devices that are used for XIP image execution. Block addressable devices such as disk storage systems are generally not usable for execute in place images because memory in such devices must be read one block at a time and is not addressable at the individual instruction level.
Contemporary computer systems combine various types of memory and storage subsystems such flash memory, ROM, RAM, and disk storage. Read access times can vary greatly among various storage devices and often influences the combination of the various storage subsystems to maximize cost and performance. For example, the following list of devices have read access times that are listed in order starting with the shortest read access time to the longest read access times: SDRAM, flash memory (NAND and NOR are not differentiated, it depends on read mode), and then disk drives. For non-volatile memory types, erase and write times, or the ability to update data, also varies greatly among device types. For example, the following device types are listed in order starting with the shortest write times: NAND flash memory, NOR flash memory, and then disk drives. SDRAM has the fastest erase and write times.
NAND flash memory typically does not support executing code in place from the flash memory part and thus typically requires a linear non-volatile memory solution such as NOR flash memory or ROM for boot-time initialization. NAND vendors offers hybrid designs like NAND flash memory with a small NOR boot block or logic designs that enable a CPU to read from a particular good NAND block at reset time to address this issue.
NOR flash memory provides non-volatile storage. Typically there is no BIOS or boot loader present, this means that code execution will need to start from the NOR flash memory at CPU reset, thus prohibiting compression of the entire image to save space and perhaps allow for a smaller NOR part.
Non-writeable ROM, most likely production masked ROM, provides non-volatile storage. The topology is very similar to NOR flash memory with the same design trade offs. The main benefit of ROM designs over NOR flash memory is typically related to the cost advantage, depending on volumes, of replacing the NOR flash memory with a ROM part. A downside is effectively the lack of a real software upgrade path for field devices other than physical replacement of the ROM part.
A single NAND flash memory device provides non-volatile storage. Because NAND is a block device and does not support a linear interface, the CPU cannot directly execute code stored in NAND flash memory. As a result, for this configuration to work, conventionally a non-volatile linear storage area is required—many hybrid NAND flash memory parts contain a small linear NOR region called a boot block.
NAND flash memory is a block-accessed storage device, very much like a conventional electromechanical disk drive with a serial interface. For this reason, NAND flash memory is generally not suitable for XIP solutions because the CPU requires program memory to be linear. Instead, NAND flash memory images are typically moved to DRAM during execution either at boot time or by OS paging. This ties the cost of NAND flash memory-based devices more closely to the fluctuating DRAM market prices.
The typically shorter erase and write access times for NAND flash memory over conventional linear flash memory is an advantage. Read access times for both NAND flash memory and conventional linear flash memory are comparable. In addition, the erase cycle is typically an order of magnitude greater than linear flash memory, thereby extending the lifespan of the NAND flash memory part. This cost-per-byte benefit and the larger storage sizes offset the added complexity involved in the NAND solution and any additional expense in DRAM.
The standard ATA or IDE hard disk drive can also be a good choice for image storage. Like NAND flash memory, disk drives are non-linear, block-accessed devices. This means that a CPU cannot directly execute (XIP) code from disk. Instead, the XIP code must first be copied to linear memory (DRAM), where the CPU can execute it. Read and write access times are significantly longer than that of solid-state devices, but the storage capacity of disk drives is much larger.